package com.yc.controller;

import com.yc.entity.OrderEntity;
import com.yc.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.ws.rs.POST;
import java.util.List;

/**
 * @author yangc91@bngrp.com
 * @date 2020/8/6 14:11
 */
@RestController
public class OrderController {
    @Autowired
    private OrderService orderService;
    @GetMapping("/getAll")
    public List<OrderEntity> getAllOrder(){
        return orderService.getAllOrder();
    }

    @PostMapping("/insert")
    public String insert(@RequestParam Long id ){
        return orderService.insert(id);
    }
    @GetMapping("/test")
    public Object test(){
        return "ok";
    }
}
